<?php
echo $this->Html->script('tab/javascripts/vendor/modernizr.custom');
echo $this->Html->css('tab/stylesheets/style');
?>
<style>
    a.price-btn {
        display: block;
        background-color: #333333;
        color: #fff;
        padding: 4px;
        text-align: center;
        text-transform: uppercase;
        font-size: 14px;
        margin-top: 8px;
    }


</style>
<div class="row">
    <div class="span12">
        <div class='tabs tabs_animate'>
            <ul class='horizontal'>
                <li class="active"><a href="#tab-1">Latest</a></li>
                <li><a href="#tab-2"><?php echo __('DETACHBD HOUSE') ?></a></li>
                <li><a href="#tab-3"><?php echo __('CONDOMINIUM') ?></a></li>
            </ul>
            <div id='tab-1'>
                <?php if (isset($newArr) && sizeof($newArr) != 0) { ?>
                    <?php $i = 0; ?>
                    <?php foreach ($newArr as $a): ?>   
                        <div class="span3 <?php echo $i % 4 == 0 ? 'no-margin' : ''; ?>">
                            <div class="list-thumb">
                                <div>
                                    <h5 class="no-padding"><?php echo $a['ProjectDetail'][0]['title'] ?></h5>
                                </div>
                                <?php echo $this->Html->image($a['Project']['default_pic'], array('height' => '130px', 'width' => '100%')); ?>
                            </div>
                            <div class="list-content">
                                <?php $lang = 'name_' . strtolower($a['ProjectDetail'][0]['language']);?>
                                <?php $adds = $a['Amphur'][$lang].', '.$a['Amphur']['Province'][$lang];?>
                                <?php echo $a['PropertyType'][$lang] . ', ' . $adds ?>
                                <?php echo $this->Html->link('View Property', '/Projects/view/' . $a['Project']['id'], array('class' => 'price-btn', 'target' => '_blank')) ?>
                            </div>
                        </div>
                        <?php $i++; ?>
                    <?php endforeach; ?> 
                <?php }else { ?>
                    <h5 class="text-center c-red margin-top">Not found project.</h5>
                <?php } ?>
            </div>
            <div id='tab-2'>
                <?php if (isset($houseArr) && sizeof($houseArr) != 0) { ?>
                    <?php $i = 0; ?>
                    <?php foreach ($houseArr as $a): ?>   
                        <div class="span3 <?php echo $i % 4 == 0 ? 'no-margin' : ''; ?>">
                            <div class="list-thumb">
                                <div>
                                    <h5 class="no-padding"><?php echo $a['ProjectDetail'][0]['title'] ?></h5>
                                </div>
                                <?php echo $this->Html->image($a['Project']['default_pic'], array('height' => '130px', 'width' => '100%')); ?>
                            </div>
                            <div class="list-content">
                                <?php $lang = 'name_' . strtolower($a['ProjectDetail'][0]['language']);?>
                                <?php $adds = $a['Amphur'][$lang].', '.$a['Amphur']['Province'][$lang];?>
                                <?php echo $a['PropertyType'][$lang] . ', ' . $adds ?>
                                <?php echo $this->Html->link('View Property', '/Projects/view/' . $a['Project']['id'], array('class' => 'price-btn', 'target' => '_blank')) ?>
                            </div>
                        </div>
                        <?php $i++; ?>
                    <?php endforeach; ?> 
                <?php }else { ?>
                    <h5 class="text-center c-red margin-top">Not found project.</h5>
                <?php } ?>
            </div>
            <div id='tab-3'>
                <?php if (isset($condoArr) && sizeof($condoArr) != 0) { ?>
                    <?php $i = 0; ?>
                    <?php foreach ($condoArr as $a): ?>   
                        <div class="span3 <?php echo $i % 4 == 0 ? 'no-margin' : ''; ?>">
                            <div class="list-thumb">
                                <div>
                                    <h5 class="no-padding"><?php echo $a['ProjectDetail'][0]['title'] ?></h5>
                                </div>
                                <?php echo $this->Html->image($a['Project']['default_pic'], array('height' => '130px', 'width' => '100%')); ?>
                            </div>
                            <div class="list-content">
                                <?php $lang = 'name_' . strtolower($a['ProjectDetail'][0]['language']);?>
                                <?php $adds = $a['Amphur'][$lang].', '.$a['Amphur']['Province'][$lang];?>
                                <?php echo $a['PropertyType'][$lang] . ', ' . $adds ?>
                                <?php echo $this->Html->link('View Property', '/Projects/view/' . $a['Project']['id'], array('class' => 'price-btn', 'target' => '_blank')) ?>
                            </div>
                        </div>
                        <?php $i++; ?>
                    <?php endforeach; ?> 
                <?php }else { ?>
                    <h5 class="text-center c-red margin-top">Not found project.</h5>
                <?php } ?>
            </div>
        </div>
    </div>
</div>

<?php
echo $this->Html->script('tab/javascripts/vendor/waypoints.min');
echo $this->Html->script('tab/javascripts/vendor/waypoints-sticky.min');
echo $this->Html->script('tab/javascripts/vendor/jquery.tabslet.min');
echo $this->Html->script('tab/javascripts/vendor/rainbow-custom.min');
echo $this->Html->script('tab/javascripts/initializers');
?>